package org.jeecg.common.easyoa.api.factory;

import feign.hystrix.FallbackFactory;
import org.jeecg.common.easyoa.api.IEasyOaBaseAPI;
import org.jeecg.common.easyoa.api.fallback.EasyOaBaseAPIFallback;
import org.springframework.stereotype.Component;

/**
 *
 */
@Component
public class EasyOaBaseAPIFallbackFactory implements FallbackFactory<IEasyOaBaseAPI> {

    @Override
    public IEasyOaBaseAPI create(Throwable throwable) {
        EasyOaBaseAPIFallback fallback = new EasyOaBaseAPIFallback();
        fallback.setCause(throwable);
        return fallback;
    }

}
